package escritorio.conn;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import escritorio.javaBeans.Vara;

public class VaraDao {
	private Connection conn;

	public VaraDao() {
		super();
		this.conn = new ConnectionFactory().getConnection();
	}
	
	public void insereVara (Vara vara){
		String sql = "insert into vara "
				+ "(descricao)"
				+ " Values (?)";
		try{
			PreparedStatement stmt = conn.prepareStatement(sql);
			stmt.setString(1, vara.getDescricao());
			
			stmt.execute();
			stmt.close();
		} catch (SQLException e){
			throw new ConnErro(null, e);
		}
	}

}
